# coding: utf-8

'''
author:  O_O
'''

import itertools

from django.conf import settings
import json

PERMS_CONFIG = json.load(open('../config/perm_conf.json'))
# print(PERMS_CONFIG)

# ALL_PERMS 数据格式
# [
#    ('perms_code1', 'perms1 description'),
#    ('perms_code2', 'perms2 description'),
#    ...
# ]
ALL_PERMS = list(itertools.chain.from_iterable([
    [(perm['codename'], perm['name']) for perm in perm_config['perms']]
    for perm_config in PERMS_CONFIG
]))
